package company.permissionsystem.security.roleassignment.factory;

import company.permissionsystem.security.roleassignment.PowerAssignment;

import java.util.HashMap;
import java.util.Map;

public class RoleFactory {
    static Map<String, PowerAssignment> rolePowerMap = new HashMap<>(10);

    static {
        rolePowerMap.put("ROLE_user", new UserRole("ROLE_user"));
        rolePowerMap.put("ROLE_admin", new AdminRole("ROLE_admin"));
    }

    public static PowerAssignment get(String roleName) {
        return rolePowerMap.get(roleName);
    }
}
